Q: What is the other name for a postfix expression?
Solution: Reverse polish Notation is the other name for a postfix expression whereas Polish Notation, Warsaw notation are the other names for a prefix expression.
Q: Which of the following is an example for a postfix expression?
Solution: abc*+de-+ is a postfix expression. +ab is a prefix expression and others are infix expressions.
Q: Reverse Polish Notation is the reverse of a Polish Notation.
Solution: Reverse Polish Notation is not the reverse of a polish notation. Though both NPN and RPN read the expression from left to right, they follow different strategies.
Q: What is the time complexity of evaluation of postfix expression algorithm?
Solution: The time complexity of evaluation of infix, prefix and postfix expressions is O (N).
Q: In Postfix expressions, the operators come after the operands.
Solution: In postfix expressions, the operators follow operands. In prefix expressions, the operands follow operators.
Q: Which of these operators have the highest order of precedence?
Solution: The highest order of precedence is ~ and ^ followed by ‘*’ ,’ /’, ‘+’ ,’-‘ and then braces ‘(‘ ‘)’.
Q: Which of the following is not an application of stack?
Solution: Line at ticket counter is an application of queue whereas conversion of infix to postfix expression, balancing symbols, line at ticket counter are stack applications.
Q: While evaluating a postfix expression, when an operator is encountered, what is the correct operation to be performed?
Solution: When an operator is encountered, the first two operands are popped from the stack, they are evaluated and the result is pushed into the stack.
Q: Which of the following statement is incorrect?
Solution: All prefix operators use values to their right and all postfix operators use values to their left.
Q: What is the result of the given postfix expression? abc*+ where a=1, b=2, c=3.
Solution: The infix expression is a+b*c. Evaluating it, we get 1+2*3=7.
You Have Score    | /10 |